package com.tanhua.mongo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(value = "comment")
public class Comment implements Serializable {

    private ObjectId id;//主键
    private ObjectId publishId;//动态id
    private Integer commentType;//评论类型,1 点赞 2  评论 3 喜欢
    private String content;// 当commentType=2的时候，这个字段有值
    private Long userId;//评论人，谁写的评论
    private Long publishUserId;//被评论人
    private Long created;
    private Integer likeCount = 0;//当前评论的点赞数


}
